<?php

/**
 * @author Terry & 千里孤坟
 * @copyright 2009
 * 特殊技能
 */

class SpecClass {

	public function __construct() {
		$this->id = -1;
		$this->name = "特殊类基类";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 0;
	}
	
	public function checkex($a) {
		if(isset($this->excid) && in_array($a->cid,$this->excid)) {
			$this->name = "<font color=blue>EX".$this->name."</font>";
			$this->ex = 1;
			$this->exskset();
		}
	}
	
	public function checkar($a) {
		if(method_exists($this,'arskset') && CalHelper::is_arise($a) === true) {
			$this->name = "<font color=red>真·".$this->name."</font>";
			$this->ar = 1;
			$this->arskset();
		}
	}

	public function exskset() {
		return 1;
	}

	public function pre_action($a,$b) {
		return 1;
	}
	
	public function spec_action($a) {
		return 1;
	}
}

class SingleSpecClass extends SpecClass {

	public function start($a,$b,$atkid,$defid,$defer) {		
		$this->checkex($a[$atkid]);
		$this->checkar($a[$atkid]);
		CalHelper::cost_cal($a[$atkid],$this);
		foreach($defer->defskill_status as $dss) {
			if ($dss->on == 1)
				$dss->action($a[$atkid],$defer,$sk);
		}
		$this->pre_action($a[$atkid],$defer);
		$this->spec_action($a[$atkid]);
		$this->action($a[$atkid],$defer);
	}
}

class SelfSpecClass extends SpecClass {
	
	public function start($a,$b,$atkid,$defid,$defer) {		
		$this->checkex($a[$atkid]);
		$this->checkar($a[$atkid]);
		$this->spec_action($a[$atkid]);
		CalHelper::cost_cal($a[$atkid],$this);
		$this->action($a[$atkid]);		
	}
}

class AllSpecClass extends SpecClass {

	public function start($a,$b,$atkid,$defid,$defer) {		
		$this->checkex($a[$atkid]);
		$this->checkar($a[$atkid]);
		$sk = clone $this;
		CalHelper::cost_cal($a[$atkid],$sk);
		$_SESSION['show'] .= $a[$atkid]->name."发动".$this->name."。<br>";
		$sk->spec_action($a[$atkid]);
		foreach($b as $d) {
			if($d->hp <= 0) continue;			
			foreach($d->defskill_status as $dss) {
				if ($dss->on == 1)
					$dss->action($d,$sk);
			}
			$sk->action($a[$atkid],$d);
		}		
	}
}

class GroundSpecClass extends SpecClass {

	public function __construct() {
		$this->id = -1;
		$this->name = "全场特殊类基类";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 0;
	}

	public function start($a,$b,$atkid,$defid,$defer) {
		
		$this->checkex($a[$atkid]);
		$sk = clone $this;
		CalHelper::cost_cal($a[$atkid],$this);
		$c = array_merge($a,$b);
		if($this->id == 267 && $this->ex == 1) {	//for SilentPray hack.
			$c = $b;
		} elseif($this->id == 233 && $this->ex == 1) {	//for ChaosFog hack.
			$c = $a;
		} 
		$_SESSION['show'] .= $a[$atkid]->name."发动".$this->name."<br>";
		$this->pre_action($a[$atkid],$d);
		foreach($c as $d) {
			if($d->hp <= 0) continue;
			$sk = clone $this;
			$sk->action($a[$atkid],$d);
		}
	}

}


class Analyze extends SingleSpecClass {
	public function __construct() {
		$this->id = 264;
		$this->name = "アナライズ";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 30;
		$this->ap = 2;
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."向".$b->name."进行分析，对方状态完全暴露。<br>";
		StatusHelper::avoidup($a,$b,10);
	}
	
}

class OtomiNoInori extends SelfSpecClass {
	public function __construct() {
		$this->id = 265;
		$this->name = "乙女の祈り";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 30;
		$this->ap = 2;
	}
	
	public function action($a) {
		$_SESSION['show'] .= $a->name."开始祈祷，试图恢复场景。<br>";
		if($a->gender == 1) {
			$_SESSION['show'] .= "由于".$a->name."是男性，什么也没发生。<br>";
			return 0;
		}
		$_SESSION['T'] = 1;
		$_SESSION['show'] .= "场景已恢复为火花帝国城下町<br>";
	}
}

class JouseNoInori extends SelfSpecClass {
	public function __construct() {
		$this->id = 266;
		$this->name = "常世の祈り";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 20;
		$this->ap = 2;
	}
	
	public function action($a) {
		$_SESSION['show'] .= $a->name."开始祈祷，试图改变场景。<br>";
		$_SESSION['T'] = terrain_cal();
		$_SESSION['show'] .= "场景重新选择了！<br>";
	}
	
}

class SilentPray extends GroundSpecClass {

	public function __construct() {
		$this->id = 267;
		$this->name = "静寂の祈り";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 5;
		$this->excid = array(132);
	}
	
	public function action($a,$b) {
		StatusHelper::goodestroy($b);
		StatusHelper::badestroy($b);
		StatusHelper::doubledestory($b);
		$_SESSION['show'] .= $b->name."的所有辅助效果都已被打消<br>";
	}

}

class SuckBlood extends SingleSpecClass {
	public function __construct() {
		$this->id = 268;
		$this->name = "吸血";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 40;
		$this->ap = 3;
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."正在吸取".$b->name."的血液<br>";
		$suckhp = floor($b->hp*0.08);
		if($suckhp > 0) {
			$b->hp -= $suckhp;
			$a->hp = ($a->hp + $suckhp > $a->mxhp) ? $a->mxhp : $a->hp + $suckhp;
			$_SESSION['show'] .= "吸取了${suckhp}HP<br>";
		} else {
			$_SESSION['show'] .= "但是".$b->name."的鲜血已经濒临枯竭了，".$a->name."什么也没吸到<br>";
		}
	}
	
}

class SuckMana extends SingleSpecClass {
	public function __construct() {
		$this->id = 269;
		$this->name = "吸魔";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 40;
		$this->ap = 3;
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."正在吸取".$b->name."的魔力<br>";
		$sucksp = floor($b->sp*0.08);
		if($sucksp > 0) {
			$b->sp -= $sucksp;
			$a->sp = ($a->sp + $sucksp > $a->mxsp) ? $a->mxsp : $a->sp + $sucksp;
			$_SESSION['show'] .= "吸取了${sucksp}SP<br>";
		} else {
			$_SESSION['show'] .= "但是".$b->name."的魔力已经濒临枯竭了，".$a->name."什么也没吸到<br>";
		}
	}
}

class TuolaFuli extends SelfSpecClass {
	public function __construct() {
		$this->id = 270;
		$this->name = "トラフーリ";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 30;
		$this->ap = 1;
	}
	
	public function action($a) {
		$_SESSION['show'] .= $a->name."四处张望，心里悄悄在谋划逃跑路线……<br>";
		$a->eodds += 20;
	}
}

class SuperSuckBlood extends SingleSpecClass {
	public function __construct() {
		$this->id = 271;
		$this->name = "超吸血";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 70;
		$this->ap = 5;
		$this->godds = 17;
		$this->excid = array(86);
	}

	public function exskset() {
		$this->godds = 25;
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."正在吸取".$b->name."的血液<br>";
		$suckhp = floor($b->hp*0.12);
		if($suckhp > 0) {
			$b->hp -= $suckhp;
			$a->hp = ($a->hp + $suckhp > $a->mxhp) ? $a->mxhp : $a->hp + $suckhp;
			$_SESSION['show'] .= "吸取了${suckhp}HP<br>";
		} else {
			$_SESSION['show'] .= "但是".$b->name."的鲜血已经濒临枯竭了，".$a->name."什么也没吸到<br>";
		}
		$tmp = mt_rand(1,100);
		$_SESSION['result'] .= "AP吸取发动乱数：$tmp<br>";
		if($this->godds >= $tmp) {
			CalHelper::apointchange_2($b,-1);
			CalHelper::apointchange_2($a,1);
			$_SESSION['show'] .= "AP吸取追加！<br>";
		}
	}
	
}

class SuperSuckMana extends SingleSpecClass {
	public function __construct() {
		$this->id = 272;
		$this->name = "超吸魔";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 70;
		$this->ap = 5;
		$this->godds = 17;
		$this->excid = array(44);
	}

	public function exskset() {
		$this->godds = 25;
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."正在吸取".$b->name."的魔力<br>";
		$sucksp = floor($b->sp*0.12);
		if($sucksp > 0) {
			$b->sp -= $sucksp;
			$a->sp = ($a->sp + $sucksp > $a->mxsp) ? $a->mxsp : $a->sp + $sucksp;
			$_SESSION['show'] .= "吸取了${sucksp}SP<br>";
		} else {
			$_SESSION['show'] .= "但是".$b->name."的魔力已经濒临枯竭了，".$a->name."什么也没吸到<br>";
		}
		$tmp = mt_rand(1,100);
		$_SESSION['result'] .= "AP吸取发动乱数：$tmp<br>";
		if($this->godds >= $tmp) {
			CalHelper::apointchange_2($b,-1);
			CalHelper::apointchange_2($a,1);
			$_SESSION['show'] .= "AP吸取追加！<br>";
		}
	}
}

class ChaosFog extends GroundSpecClass {

	public function __construct() {
		$this->id = 273;
		$this->name = "混迷の霧";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 50;
		$this->ap = 4;
		$this->excid = array(119,129);
		$this->godds = 65;
	}
	
	public function exskset() {
		$this->sp = 60;
		$this->ap = 5;
		$this->godds = 85;
	}

	public function pre_action($a,$b) {
		$tmp = mt_rand(1,100);
		$_SESSION['result'] .= $this->name."乱数：$tmp<br>";
		if($this->godds >= $tmp) {
			$this->succ = 1;
			$_SESSION['show'] .= "发动成功，相关目标已被迷雾包围<br>";
		} else {
			$this->succ = 0;
			$_SESSION['show'] .= "发动失败，迷雾被驱散了<br>";
		}
	}

	public function action($a,$b) {
		if($this->succ == 1) {
			StatusHelper::chaosfog($b);
		}
	}

}

class HateCry extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 274;
		$this->name = "恨みの慟哭";			//技能名称
		$this->type = 9;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 120;
		$this->ap = 12;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
		$this->god_abn = 1;
		$this->abase = 60;
		$this->isunique = 1;
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."凄惨的哭了起来，充满着对".$b->name."的怨恨。<br>";
		StatusHelper::random_abn($a,$b,$this->abase,$this);
	}
}

class SuccubusParty extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 275;
		$this->name = "夢魔の宴";			//技能名称
		$this->type = 9;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 140;
		$this->ap = 14;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
		$this->ref = 0;			//强制反射
		$this->god_abn = 1;
		$this->abase = 60;
		$this->isunique = 1;
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."<br>";
		StatusHelper::random_abn($a,$b,$this->abase,$this);
	}
}

class SinSong extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 276;
		$this->name = "咎歌";			//技能名称
		$this->type = 9;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 130;
		$this->ap = 12;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
								
		$this->ref = 0;			//强制反射
		$this->god_abn = 1;
		$this->abase = 50;
		$this->isunique = 1;
	}
	
	public function spec_action($a) {
		if(CalHelper::ifgroupskill($a) == 10) {
			$tmp = mt_rand(1,100);
			$_SESSION['result'] .= "天の裁定乱数：$tmp<br>";
			if(15 >= $tmp) {			
				$a->sp = ($a->sp + 50 > $a->mxsp) ? $a->mxsp : $a->sp + 50;
				$_SESSION['show'] .= $a->name."发动天の裁定，SP恢复50<br>";
				return 1;
			}
		}
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."<br>";
		StatusHelper::random_abn($a,$b,$this->abase,$this);
		StatusHelper::luk_down_20($b);
	}
}

class RuinDance extends AllAbnSkill {
	
	public function __construct() {
		$this->id = 277;
		$this->name = "舞い降りる厄災";			//技能名称
		$this->type = 9;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 150;
		$this->ap = 14;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
								
		$this->ref = 0;			//强制反射
		$this->god_abn = 1;
		$this->abase = 50;
		$this->isunique = 1;
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."<br>";
		StatusHelper::random_abn($a,$b,$this->abase,$this);
		StatusHelper::luk_down_20($b);
	}
}

class CharmFruit extends SingleAbnSkill {
	
	public function __construct() {
		$this->id = 278;
		$this->name = "诱惑の果实";			//技能名称
		$this->type = 9;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 100;
		$this->ap = 10;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
								
		$this->ref = 0;			//强制反射
		$this->abase = -90;
		$this->isunique = 1;
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."<br>";
		StatusHelper::lure($a,$b,$this->abase,$this);
	}
}

class DoYouWantToDie extends AllAttack {
	
	public function __construct() {
		$this->id = 279;
		$this->name = "死んでくれる？";			//技能名称
		$this->type = 9;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 220;
		$this->ap = 18;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
								
		$this->ref = 0;			//强制反射
		$this->puredead = 1;
		$this->isunique = 1;
		$this->dtype = 7;
	}

	public function pre_attack($sk,$a,$b) {
	
		if($_SESSION['turn'] % 2 == 0) {
			$this->dbase = 0;
			return 1;
		}
		switch($b->res[7]) {
			case 0:{$this->dbase = -50;break;}
			case 1:{$this->dbase = -40;break;}
			case 2:{$this->dbase = -30;break;}
			case 3:{$this->dbase = -20;break;}
			case 4:{$this->dbase = -20;break;}
			case 5:{$this->dbase = -60;break;}
			default:{$this->dbase = -50;break;}
		}
		$b->res[7] = 0;
	}
	
}

class DeathSigh extends AllAttack {
	
	public function __construct() {
		$this->id = 280;
		$this->name = "亡者の嘆き";			//技能名称
		$this->type = 9;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 200;
		$this->ap = 17;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->res = 1;
		$this->tgtnum = 1;		//全体攻击时实际攻击人数
								
		$this->ref = 0;			//强制反射
		$this->puredead = 1;
		$this->dbase = -90;
		$this->isunique = 1;
		$this->dtype = 9;		
	}

	public function pre_attack ($sk,$a,$b) {
		if($b->before_status[27]->on != 1) {
			$this->dbase = 0;
		}
	}
	
	public function kill_desc($a,$b) {
		$_SESSION['show'] .= "你的生命 就当做盟约之证由我带走吧<br>";
		CalHelper::cgdisplay('nelu_1.jpg');
	}

	public function attk_desc($a,$b) {
		$_SESSION['show'] .= $a->name."发动".$this->name."，黄泉的悲歌穿入".$b->name."的大脑<br>";
	}
	
}

class MirrorPrison extends SingleSpecClass {

	public function __construct() {
		$this->id = 282;
		$this->name = "ミラープリズン";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 130;
		$this->ap = 10;
		$this->isunique = 1;
		$this->v = 1;
	}
	
	public function arskset() {
		$this->v = 3;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."施放水镜炼狱<br>";
		if($b->before_status[75]->on == 1) {
			$_SESSION['show'] .= $this->name."已经生效，不能重复使用。<br>";
		} else {
			$b->before_status[75]->on = 1;
			$b->atkskill_status[26]->on = 1;
			$b->atkskill_status[26]->on = $this->v;
		}
	}

}

class NightAura extends SingleSpecClass {

	public function __construct() {
		$this->id = 283;
		$this->name = "夜のオーロラ";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 150;
		$this->ap = 13;
		$this->isunique = 1;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= "夜色少女的左眼发出不吉的红玉色光芒。<br>一切耐性在魔眼前都毫无意义，魔眼 ".$this->name."<br>";
		CalHelper::cgdisplay('painex_1.png');
		if($b->defskill_status[6]->on == 1) {
			$_SESSION['show'] .= $b->name."受到二十八星宿的守护，耐性打消无效。<br>";
			return 0;
		}
		if($b->before_status[54]->on == 1) {
			$_SESSION['show'] .= $this->name."已经生效，不能重复使用。<br>";
		} else {
			$_SESSION['show'] .= $b->name."耐性被完全打消。<br>";
			$b->before_status[54]->on = 1;
			$b->before_status[54]->committer = $a->uuid;
		}
	}

}

class DevilUnison extends SingleSpecClass {
	public function __construct() {
		$this->id = 284;
		$this->name = "魔界の調べ";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 100;
		$this->ap = 10;
		$this->isunique = 1;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."在胸前划出六芒星，向".$b->name."发动".$this->name."。<br>";
		if($b->before_status[55]->on == 1) {
			$_SESSION['show'] .= $this->name."已经生效，不能重复使用。<br>";
		} else {
			$b->before_status[55]->on = 1;
		}
	}
	
}

class IllusionCeremony extends SingleSpecClass {

	public function __construct() {
		$this->id = 285;
		$this->name = "幻影の秘儀";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 120;
		$this->ap = 12;
		$this->isunique = 1;

		$this->bodds = 70;
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."。<br>";
		$tmp = mt_rand(1,100);
		$_SESSION['result'] .= "成功率：".$this->bodds."<br>";
		if($this->bodds >= $tmp) {
			$_SESSION['show'] .= "魔力发动成功，".$b->name."陷入厄运状态，乱数：".$tmp."<br>";
			StatusHelper::zero_luk($b);
		} else {
			$_SESSION['show'] .= $b->name."没有受到任何影响。乱数：".$tmp."<br>";
		}
					
	}
	
}

class LostWord extends AllSpecClass {

	public function __construct() {
		$this->id = 286;
		$this->name = "ロストワード";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 170;
		$this->ap = 16;
		$this->isunique = 1;

		$this->bodds = 60;
		$this->v = 4;
	}
	
	public function arskset() {
		$this->bodds = 80;
		$this->v = 6;
	}
	
	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."吟唱着古老的念咒。<br>";
		$tmp = mt_rand(1,100);
		$_SESSION['result'] .= "成功率：".$this->bodds."<br>";
		if($this->bodds >= $tmp) {
			$_SESSION['show'] .= "诅咒成功，".$b->name."AP大大下降，乱数：".$tmp."<br>";
			CalHelper::apointchange_2($b,$this->v);
		} else {
			$_SESSION['show'] .= $b->name."没有受到任何影响。乱数：".$tmp."<br>";
		}
					
	}
	
}

class ColorfulWind extends SelfSpecClass {

	public function __construct() {
		$this->id = 287;
		$this->name = "極彩の疾風";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 130;
		$this->ap = 12;
		$this->isunique = 1;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."发动".$this->name."<br>";
		StatusHelper::cwind($a);
	}

}

class SkyEncourage extends SingleSpecClass {

	public function __construct() {
		$this->id = 288;
		$this->name = "天の鼓動";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 100;
		$this->ap = 10;
		$this->isunique = 1;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."<br>";
		StatusHelper::skyencourage($b);
	}

}

class HanaBless extends SingleSptClass {

	public function __construct() {
		$this->id = 289;
		$this->name = "パナケイアの祝福";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 130;
		$this->ap = 13;
		$this->isunique = 1;
		$this->buffsk = 1;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."<br>";
		StatusHelper::all_up_30($b);
	}

}

class LordCommand extends SingleSpecClass {
	public function __construct() {
		$this->id = 290;
		$this->name = "魔王の号令";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 160;
		$this->ap = 12;

		$this->godds = 70;
		$this->isunique = 1;
	}
	
	public function action($a,$b) {

		if($a->uuid == $b->uuid) {
			$_SESSION['show'] .= "没有人理睬你的独角戏...<br>";
			return 0;
		}

		$_SESSION['show'] .= $a->name."向".$b->name."下达号令。<br>";

		if($this->godds >= mt_rand(1,100)) {
			$_SESSION['show'] .= "成功，".$b->name."立刻行动。<br>";
			$b->atkskill_status[36]->on = 1;
		} else {
			$_SESSION['show'] .= "失败，".$b->name."无视你的指令。<br>";
		}
	}
	
}

class StarsGuard extends AllSptClass {

	public function __construct() {
		$this->id = 291;
		$this->name = "二十八宿の守護";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 160;
		$this->ap = 15;
		$this->goal = 0;
		$this->isunique = 1;
	}

	public function action($a,$b) {
		CalHelper::cgdisplay('teaplum_9.jpg');
		$_SESSION['show'] .= "未来的星光将在此刻闪耀，<br>我将希望赐予这片大地。<br>";
		StatusHelper::stars_guard($b);
	}

}

class MahaAnalyze extends SelfSpecClass {

	public function __construct() {
		$this->id = 292;
		$this->name = "マハアナライズ";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 160;
		$this->ap = 12;
		$this->isunique = 1;
	}
	
	public function action($a) {
		$_SESSION['show'] .= $a->name."向敌全体进行分析，对方状态完全暴露。<br>";
		StatusHelper::avoidup($a,NULL,20);
	}
	
}

class TakeOffCloth extends AllSpecClass {

	public function __construct() {
		$this->id = 293;
		$this->name = "汝の衣は無力なり";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 230;
		$this->ap = 18;
		$this->isunique = 1;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."<br>";
		if($b->defskill_status[6]->on == 1) {
			$_SESSION['show'] .= $b->name."受到二十八星宿的守护，耐性打消无效。<br>";
			return 0;
		}
		StatusHelper::clothdown($a,$b);
	}

}

class DarkSun extends AllAttack {

	public function __construct() {
		$this->id = 294;
		$this->name = "黒い太陽";			//技能名称
		$this->type = 8;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 250;
		$this->ap = 28;
		$this->isunique = 1;
		
		$this->puredead = 1;
		$this->abase = 60;
		$this->dtype = 8;
		$this->dbase = 50;
		$this->god_abn = 1;
	}
	
	public function spec_action($a) {
		if(CalHelper::ifgroupskill($a) == 10) {
			$tmp = mt_rand(1,100);
			$_SESSION['result'] .= "天の裁定乱数：$tmp<br>";
			if(15 >= $tmp) {			
				$a->sp = ($a->sp + 50 > $a->mxsp) ? $a->mxsp : $a->sp + 50;
				$_SESSION['show'] .= $a->name."发动天の裁定，SP恢复50<br>";
				return 1;
			}
		}
	}

	public function pre_attack($sk,$a,$b) {
		StatusHelper::goodestroy($b);
		StatusHelper::doubledestory($b);
		StatusHelper::all_down_20($b);
		StatusHelper::random_abn($a,$b,$this->abase,$this);
	}

}

class ShinSummerDream extends AllCureSkill {

	public function __construct() {
		$this->id = 295;
		$this->name = "真夏の夜の夢";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 230;
		$this->ap = 18;
		$this->isunique = 1;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= "伤病、痛楚、心魔、肉欲……<br>";
		$_SESSION['show'] .= "幻入真夏之夜，斩断凡尘之苦！<br>";
		CalHelper::cgdisplay('lili_dream.jpg');
		StatusHelper::cure_allspt($b);
		StatusHelper::badestroy($b);
		$b->hp = $b->hp + floor($b->mxhp*0.6) > $b->mxhp ? $b->mxhp : $b->hp + floor($b->mxhp*0.6);
	}

}

class JindoMistre extends AllSptClass {

	public function __construct() {
		$this->id = 296;
		$this->name = "シンドゥミステリー";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 170;
		$this->ap = 17;
		$this->goal = 0;
		$this->isunique = 1;
	}
	
	public function spec_action($a) {
		if(CalHelper::ifgroupskill($a) == 10) {
			$tmp = mt_rand(1,100);
			$_SESSION['result'] .= "天の裁定乱数：$tmp<br>";
			if(15 >= $tmp) {			
				$a->sp = ($a->sp + 50 > $a->mxsp) ? $a->mxsp : $a->sp + 50;
				$_SESSION['show'] .= $a->name."发动天の裁定，SP恢复50<br>";
				return 1;
			}
		}
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."。<br>";
		StatusHelper::all_up_20($b);
	}

}

class LoveSmile extends AllCureSkill {
	
	public function __construct() {
		$this->id = 297;
		$this->name = "慈愛の微笑み";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 300;
		$this->tp = 30;
		$this->isunique = 1;		
	}
	
	public function action($a,$b) {
		CalHelper::cgdisplay('waterp_1.jpg');
		$hp = round($b->mxhp*0.6);
		
		$b->hp += $hp;
		if($b->hp > $b->mxhp) $b->hp = $b->mxhp;				
				
		$_SESSION['result'] .= "回复量：".$hp."<br>";
				
		if($b->defskill_status[0]->on == 1) {
			$_SESSION['show'] .= $b->name."爬起来了。<br>";
			$b->defskill_status[0]->cancel($b);
		}

		StatusHelper::cure_allspt($b);
		StatusHelper::badestroy($b);
		StatusHelper::all_up_20($b);
	}
}

/*
class BodRelief extends SelfSpecClass {

	public function __construct() {
		$this->id = 298;
		$this->name = "観世音の済度";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 180;
		$this->ap = 18;
		$this->isunique = 1;		
		$this->nodone = 1;
	}
	
	public function action($a) {
		$_SESSION['show'] .= $a->name."发动".$this->name."<br>";
		if($a->hp >= round($a->mxhp*0.4)) { 
			$a->hp = round($a->mxhp*0.4);
		} else {
			$a->hp = $a->hp * 0.6;
		}
		$a->before_status[17]->action($a,1);
		StatusHelper::all_up_20($a);
	}
}

class DragonArterysSpell extends SelfSpecClass {

	public function __construct() {
		$this->id = 299;
		$this->name = "極·龍脈の秘術";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 180;
		$this->ap = 18;
		$this->isunique = 1;	
		$this->nodone = 1;	
	}
	
	public function action($a) {
		$_SESSION['show'] .= $a->name."发动".$this->name."<br>";
		if($a->hp >= round($a->mxhp*0.4)) { 
			$a->hp = round($a->mxhp*0.4);
		} else {
			$a->hp = $a->hp * 0.6;
		}
		$a->before_status[17]->action($a,1);
		StatusHelper::doubledmgdouble($a);
	}
}
*/

class QieOpenEye extends SelfSpecClass {

	public function __construct() {
		$this->id = 608;
		$this->name = "黒い神の開目";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 130;
		$this->ap = 12;
		$this->isunique = 1;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."发动".$this->name."<br>";
		StatusHelper::openeye($a);
	}

}

class RiKaaMuRose extends ReliveCureSkill {

	public function __construct() {
		$this->id = 609;
		$this->name = "リカームロス";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 130;
		$this->ap = 13;
		
		$this->plus = 1;		//附加回复率
		$this->bonus = 0;		//附加回复值			
		
		$this->tgtnum = 0;		//全体回复时实际人数
					
	}
	
	public function action($a,$b) {
		$b->hp = round($b->mxhp * 0.7);
		StatusHelper::resetall($b);
		//倒地中
		$b->before_status[0]->on = 1;
		$b->defskill_status[0]->on = 1;
		$_SESSION['result'] .= "回复量：".$b->hp."<br>";
	}
}

class Soma extends ReliveCureSkill {

	public function __construct() {
		$this->id = 610;
		$this->name = "ソーマ神権現";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 160;
		$this->ap = 16;
		
		$this->plus = 1;		//附加回复率
		$this->bonus = 0;		//附加回复值			
		
		$this->tgtnum = 0;		//全体回复时实际人数
					
	}
	
	public function action($a,$b) {
		$b->hp = $b->mxhp;
		StatusHelper::resetall($b);
		//倒地中
		$b->before_status[0]->on = 1;
		$b->defskill_status[0]->on = 1;
		$_SESSION['result'] .= "回复量：".$b->hp."<br>";
	}
}

class NetherworldLure extends SingleAttack {
	
	public function __construct() {
		$this->id = 611;
		$this->name = "黄泉への誘い";			//技能名称
		$this->type = 9;				//组别
	
		$this->hp = 0;			//消耗
		$this->sp = 170;
		$this->ap = 15;
		
		$this->ahits = 0;			//异常命中补正
		$this->shits = 0;			//即死命中补正
		
		$this->res = 1;
		$this->tgtnum = 0;		//全体攻击时实际攻击人数
								
		$this->ref = 0;			//强制反射
		$this->puredead = 1;
		$this->dbase = -90;
		$this->isunique = 1;
		$this->dtype = 9;		
	}

	public function pre_attack ($sk,$a,$b) {
		if(StatusHelper::has_abn($b) === 0) {
			$this->dbase = 0;
		}
	}
	
	public function attk_desc($a,$b) {
		$_SESSION['show'] .= "以六芒均衡、零之名，賜汝無垢的死亡..黄泉への誘い<br>";
			CalHelper::cgdisplay('painex_2.jpg');
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."<br>";
	}
	
}

class NornTime extends SelfSpecClass {

	public function __construct() {
		$this->id = 612;
		$this->name = "ノルンの瞬き";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 170;
		$this->ap = 15;
		$this->isunique = 1;
		$this->time = 3;
	}

	public function action($a,$b) {
		$_SESSION['show'] .= $a->name."发动".$this->name."，敌全体暂时风弱，效果由裁判判断。<br>";
		StatusHelper::dummies($a,57,$this->name,$this->time);
	}

}

class RedCloak extends SingleSpecClass {

	public function __construct() {
		$this->id = 621;
		$this->name = "赤のカポーテ";			//技能名称
		$this->type = 9;				//组别		
	
		$this->hp = 0;			//消耗
		$this->sp = 140;
		$this->ap = 14;
		$this->isunique = 1;
	}

	public function action($a,$b) {
		if($a->cid == $b->cid && $a->cid == 128) {
			CalHelper::cgdisplay('nm_7.jpg');
		}
		$_SESSION['show'] .= $a->name."对".$b->name."发动".$this->name."<br>";
		StatusHelper::rcloak($b);
	}

}

?>
